package priv.yiyuan.example.design.pay02;

/**
 * 第三方支付适配器
 *
 * @author YiYuan
 * @data 2025/8/8
 * @apoNote
 */
public class ThirdPartyPaymentAdapter implements UnifiedPayment {

    private ThirdPartyPayment thirdPartyPayment;

    private String account;

    public ThirdPartyPaymentAdapter(ThirdPartyPayment thirdPartyPayment, String account) {
        this.thirdPartyPayment = thirdPartyPayment;
        this.account = account;
    }

    @Override
    public void processPayment(double amount, String paymentDetails) {

        System.out.println("Processing third party payment - " + paymentDetails);
        thirdPartyPayment.makePayment(amount, account);

    }

}
